﻿using DevExpress.XtraTab.ViewInfo;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ApartmanYonetim
{
    public partial class AnaForm : Form
    {
        public AnaForm()
        {
            InitializeComponent();
        }

        private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e)
        {
            ClosePageButtonEventArgs a = (ClosePageButtonEventArgs)e;
            string tabpagename = a.Page.Text;
            foreach (Control xtp in tabControl.TabPages)
            {
                    if (xtp.Text == tabpagename && xtp.Text != "Anasayfa")
                    {
                        xtp.Dispose();
                        return;
                    }
            }
        }

        Siniflar.Fonksiyon fn = new Siniflar.Fonksiyon();
        Siniflar.Veritabani vt = new Siniflar.Veritabani();

        private void btnUyeListesi_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Formlar.UyeListesi form = new Formlar.UyeListesi();
            fn.TabOlustur(form);
        }

        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Formlar.UyeEkle form = new Formlar.UyeEkle();
            fn.TabOlustur(form);
        }

        private void AnaForm_Load(object sender, EventArgs e)
        {

        }

        private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Formlar.UyeListesi form = new Formlar.UyeListesi();
            form.Text = "Üye Sil";
            fn.TabOlustur(form);
        }

        private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Formlar.UyeListesi ul = new Formlar.UyeListesi();
            ul.ShowDialog();

        }
    }
}
